public class Persontest {
    public static void main(String[] args) {
        System.out.println("---------正常方法调用---------");
        NorthPerson n = new NorthPerson();
        n.eat();
        n.StewedVegetables();
        n.SteamedBuns();

        System.out.println();
        SouthPerson s = new SouthPerson();
        s.eat();
        s.Rice();
        s.Rice();




        System.out.println("---------多态方法调用---------");
        Person pn = new NorthPerson();//向上转型
        pn.eat();
        NorthPerson N = (NorthPerson) pn;//向下转型
        N.eat();
        N.SteamedBuns();
        N.StewedVegetables();

        System.out.println();
        Person ps = new SouthPerson();
        ps.eat();
        SouthPerson S = (SouthPerson) ps;
        S.eat();
        S.Rice();
        S.StirFry();

    }
}